/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author USER
 */
@Embeddable
public class ViewPhotoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "PhotoID", nullable = false)
    private int photoID;
    @Basic(optional = false)
    @Column(name = "Date", nullable = false, length = 50)
    private String date;

    public ViewPhotoPK() {
    }

    public ViewPhotoPK(int photoID, String date) {
        this.photoID = photoID;
        this.date = date;
    }

    public int getPhotoID() {
        return photoID;
    }

    public void setPhotoID(int photoID) {
        this.photoID = photoID;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) photoID;
        hash += (date != null ? date.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ViewPhotoPK)) {
            return false;
        }
        ViewPhotoPK other = (ViewPhotoPK) object;
        if (this.photoID != other.photoID) {
            return false;
        }
        if ((this.date == null && other.date != null) || (this.date != null && !this.date.equals(other.date))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "server.entity.ViewPhotoPK[photoID=" + photoID + ", date=" + date + "]";
    }

}
